--TEST--
Check for yar concurrent client with 128 calls
--SKIPIF--
<?php 
if (!extension_loaded("yar")) {
    print "skip";
}
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?>
--FILE--
<?php 
include "yar.inc";

yar_server_start();

$sequence = array();

function callback($return, $callinfo) {
    global $sequence;
    if ($callinfo) {
        $sequence[$callinfo["sequence"]] = $return;
    } else {
        $sequence[0] = NULL;
    }
}

function error_callback($type, $error, $callinfo) {
    global $sequence;
    $sequence[$callinfo["sequence"]] = $error;
}

for ($i=0; $i<128; $i++) {
    $sequence[Yar_Concurrent_Client::call(YAR_API_ADDRESS, "normal", array("xxx", "3.8"))] = NULL;
}

Yar_Concurrent_Client::loop("callback", "error_callback");

ksort($sequence);
print_r($sequence);
--EXPECTF--
Array
(
    [0] => 
    [1] => 3.8
    [2] => 3.8
    [3] => 3.8
    [4] => 3.8
    [5] => 3.8
    [6] => 3.8
    [7] => 3.8
    [8] => 3.8
    [9] => 3.8
    [10] => 3.8
    [11] => 3.8
    [12] => 3.8
    [13] => 3.8
    [14] => 3.8
    [15] => 3.8
    [16] => 3.8
    [17] => 3.8
    [18] => 3.8
    [19] => 3.8
    [20] => 3.8
    [21] => 3.8
    [22] => 3.8
    [23] => 3.8
    [24] => 3.8
    [25] => 3.8
    [26] => 3.8
    [27] => 3.8
    [28] => 3.8
    [29] => 3.8
    [30] => 3.8
    [31] => 3.8
    [32] => 3.8
    [33] => 3.8
    [34] => 3.8
    [35] => 3.8
    [36] => 3.8
    [37] => 3.8
    [38] => 3.8
    [39] => 3.8
    [40] => 3.8
    [41] => 3.8
    [42] => 3.8
    [43] => 3.8
    [44] => 3.8
    [45] => 3.8
    [46] => 3.8
    [47] => 3.8
    [48] => 3.8
    [49] => 3.8
    [50] => 3.8
    [51] => 3.8
    [52] => 3.8
    [53] => 3.8
    [54] => 3.8
    [55] => 3.8
    [56] => 3.8
    [57] => 3.8
    [58] => 3.8
    [59] => 3.8
    [60] => 3.8
    [61] => 3.8
    [62] => 3.8
    [63] => 3.8
    [64] => 3.8
    [65] => 3.8
    [66] => 3.8
    [67] => 3.8
    [68] => 3.8
    [69] => 3.8
    [70] => 3.8
    [71] => 3.8
    [72] => 3.8
    [73] => 3.8
    [74] => 3.8
    [75] => 3.8
    [76] => 3.8
    [77] => 3.8
    [78] => 3.8
    [79] => 3.8
    [80] => 3.8
    [81] => 3.8
    [82] => 3.8
    [83] => 3.8
    [84] => 3.8
    [85] => 3.8
    [86] => 3.8
    [87] => 3.8
    [88] => 3.8
    [89] => 3.8
    [90] => 3.8
    [91] => 3.8
    [92] => 3.8
    [93] => 3.8
    [94] => 3.8
    [95] => 3.8
    [96] => 3.8
    [97] => 3.8
    [98] => 3.8
    [99] => 3.8
    [100] => 3.8
    [101] => 3.8
    [102] => 3.8
    [103] => 3.8
    [104] => 3.8
    [105] => 3.8
    [106] => 3.8
    [107] => 3.8
    [108] => 3.8
    [109] => 3.8
    [110] => 3.8
    [111] => 3.8
    [112] => 3.8
    [113] => 3.8
    [114] => 3.8
    [115] => 3.8
    [116] => 3.8
    [117] => 3.8
    [118] => 3.8
    [119] => 3.8
    [120] => 3.8
    [121] => 3.8
    [122] => 3.8
    [123] => 3.8
    [124] => 3.8
    [125] => 3.8
    [126] => 3.8
    [127] => 3.8
    [128] => 3.8
)
